import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import navigation from './modules/navigation'
import table from './modules/table'
import formCard from './modules/formCard'
import createPersistedstate from 'vuex-persistedstate'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user,
    navigation,
    table,
    formCard
  },
  getters,
  plugins: [
    createPersistedstate({
      key: 'pc-store-yuanfeng',
      paths: ['user.token', 'navigation.tabsList', 'user.tokenTime']
    })
  ]

})

export default store
